package org.eae.eldf.framework.utils;

import java.util.ArrayList;
import java.util.List;

public class CommonConstant {
	public final static String J_COMPANY_USERNAME_SEPARATOR = "_company_username_separator_";
	final public static String PORTAL_USER_OBJECT="PORTAL_USER_OBJECT";
	final public static String USERNAME_FIELD="userName";
	final public static String COMPANYCODE_FIELD="companyCode";
	public static String CURRENT_LOGIN_USER_NAME_KEY="CURRENT_LOGIN_USER_NAME";
	//当前登录用户的企业代码 key
	public static String CURRENT_LOGIN_USER_COMPANYCODE_KEY="CURRENT_LOGIN_USER_COMPANYCODE";
	
	
	//当前登录用户的组织结构
	public static String LOGIN_USER_ORG_KEY="LOGIN_USER_ORG_KEY";
	
	
	
	//企业拥有的模块redis缓存key前缀 后面带上企业代码
	public static String REDIS_COMPANY_MODULE_LIST_KEY="COMPANY_MODULE:";
	
	//所有资源菜单缓存key
	public static String REDIS_MODULE_MENU_LIST_KEY="MODULE_MENU:";
	
	//企业用户所拥有的权限ID集合 redis key前缀 后面带上companyCode+username
	public static String REDIS_COMPANYUSER_PURVIEW_IDS_KEY="COMPANYUSER:PURVIEW_IDS:";
	
	//用户所有能访问的权限URL redis缓存key前缀 后面带上companyCode+username
	public static String REDIS_COMPANYUSER_PURVIEWSET_KEY="COMPANYUSER:PURVIEWSET_URLS:";
	//用户根据菜单存放有权限的url集合key
	public static String REDIS_COMPANYUSER_PURVIEWSET_KEY_BY_MENU="COMPANYUSER:PURVIEWSET_KEY_BY_MENU:";
	
	public static String REDIS_ALL_PURVIEW_PATHSET_KEY="ALL_PURVIEW_PATHSET";
	
	//当前登录用户所有有权限的url集合session key
		public static String CURRENT_LOGIN_USER_PURVIEWSET_SESSIONKEY = "CURRENT_LOGIN_USER_PURVIEWSET";
		public static String CURRENT_LOGIN_USER_ALLPURVIEWSET_SESSIONKEY = "CURRENT_LOGIN_USER_ALLPURVIEWSET";
		
		public final static String SESSION_ENTITY_VER="SESSION_ENTITY_VER";
		
		public static final String SESSION_LOV_VERSION = "SESSION_LOV_VERSION";
		
		
		public static String REDIS_PLATEFORM_TABLE_CONDITION_LIST_TEMPLATEID = "QUERY:TABLE_CONDITION_LIST:TEMPLATEID_";
		public static String REDIS_PLATEFORM_TABLE_VIEW_LIST_TEMPLATEID = "QUERY:TABLE_VIEW_LIST:TEMPLATEID_";
		public static String REDIS_PLATEFORM_TABLE_OP_LIST_CONDITIONID = "QUERY:TABLE_OP_LIST:CONDITIONID_";
		public static String REDIS_PLATEFORM_TEMPLATE_ID = "QUERY:PLATEFORM_TEMPLATE:ID_";
		public static String REDIS_PLATEFORM_TEMPLATE_CODE = "QUERY:PLATEFORM_TEMPLATE:CODE_";
		public static String REDIS_PLATEFORM_TEMPLATE_SAVE_ID = "QUERY_TEMPLATE_SAVE:ID_";
		
	//参数key 常量
		public static class ParameterKeys{
			//分页列表每页显示记录数 参数最高范围portal 最高等级Global
			final public static String LIST_PAGESIZE="LIST_PAGESIZE";
			final public static String SEARCHTYPE="SEARCHTYPE";
			final public static String SEARCHTYPE_OPT="SEARCHTYPE.OPT";
			final public static String ORG_TYPE = "ORG_TYPE";
			final public static String COMMODITYCATEGORIES = "COMMODITYCATEGORIES";
			final public static String REQUESTTYPE = "REQUESTTYPE";
			final public static String COSTCATEGORY = "COSTCATEGORY";
			final public static String WEB_INDEX_SYSTEM_NAME="WEB_INDEX_SYSTEM_NAME";//系统名称
			final public static String WEB_INDEX_LOGO_SWITCH="WEB_INDEX_LOGO_SWITCH";//logo显示开关
			final public static String WEB_INDEX_MESSAGE_SWITCH="WEB_INDEX_MESSAGE_SWITCH";//web首页消息显示开关
			final public static String WEB_INDEX_NOTICE_SWITCH="WEB_INDEX_NOTICE_SWITCH";//web首页通知显示开关
			final public static String WEB_INDEX_TASK_SWITCH="WEB_INDEX_TASK_SWITCH";//web首页任务显示开关
			final public static String WEB_INDEX_MYQUERY_SWITCH="WEB_INDEX_MYQUERY_SWITCH";//web首页我的查询显示开关
			final public static String WEB_INDEX_MYTAGS_SWITCH="WEB_INDEX_MYTAGS_SWITCH";//web首我的tags显示开关
		}
		
		public static class ParameterGroups{
			final public static String WEB_INDEX="WEB_INDEX";
		}
		
		
		public static class I18NKeys{
			final public static String EN_US="en_US";
			final public static String ZH_CN = "zh_CN";
			final public static List<String> list = new ArrayList<String>();
			static{
				list.add(ZH_CN);
				list.add(EN_US);
			}
		}
		

		//参数范围常量定义
		public static class ParameterScope{
			public static String GLOBAL = "Global";
			public static String PORTAL = "Portal";
			public static String MODULE = "Module";
			public static List<String> list=new ArrayList<String>();
			static{
				list.add(GLOBAL);
				list.add(PORTAL);
				list.add(MODULE);
			}
		}
		
		//参数等级常量定义
		public static class ParameterLevel{
			public static String GLOBAL = "Global";
			public static String ENTERPRISE = "Enterprise";
			public static String USER = "User";
			public static List<String> list = new ArrayList<String>();
			static{
				list.add(GLOBAL);
				list.add(ENTERPRISE);
				list.add(USER);
			}
		}
		//参数的数据类型常量定义
		public static class ParameterDataType{
			public static String STRING = "String";
			public static String INTEGER = "Integer";
			public static String BOOLEAN = "Boolean";
			public static String FLOAT = "Float";
			public static String DATE = "Date";
			public static String DATETIME = "DateTime";
			public static String TIME = "Time";
			public static String JSON = "JSON";
			public static String LOV = "LOV";
			public static List<String> list = new ArrayList<String>();
			static{
				list.add(STRING);
				list.add(INTEGER);
				list.add(FLOAT);
				list.add(DATE);
				list.add(DATETIME);
				list.add(TIME);
				list.add(JSON);
				list.add(LOV);
			}
		}
		
		public static class ModuleName{
			public static String GLOBAL = "Global";
			public static String PORTAL = "Portal";
			public static String NP = "Np";
			public static String MASTER = "Master";
			public static String sssss = "5s";
			public static List<String> list = new ArrayList<String>();
			static{
				list.add(GLOBAL);
				list.add(PORTAL);
				list.add(NP);
				list.add(MASTER);
				list.add(sssss);
			}
		}
		
		//供应商关系（地址、联系人） 常量
		public static class MasterLinkedEntities{
			final public static String MASTER_SUPPLIER="MASTER_SUPPLIER";
			final public static String MASTER_ADDRESS="MASTER_ADDRESS";
			final public static String MASTER_CONTACT="MASTER_CONTACT";
			
			public static List<String> list=new ArrayList<String>();
			static{
				list.add(MASTER_SUPPLIER);
				list.add(MASTER_ADDRESS);
				list.add(MASTER_CONTACT);
			}
		}
		
			//NP pr申请单  常量
			public static class Np_PrStauts{
				final public static Integer STAUTS_DRAFT=1;
				final public static Integer STAUTS_SUBMITTED=2;
				final public static Integer STAUTS_INTERNAL_APPROVED=3;
				final public static Integer STAUTS_EXTERNAL_APPROVED=4;
				final public static Integer STAUTS_PURCHASING_ACCEPTED=5;
				final public static Integer STAUTS_SP_ALLOCATED=6;
				final public static Integer STAUTS_SOURCING_COMPLETED=7;
				final public static Integer STAUTS_PR_CLOSED=8;
				final public static Integer STAUTS_CANCELLED=9;
				
				public static List<Integer> list=new ArrayList<Integer>();
				static{
					list.add(STAUTS_DRAFT);
					list.add(STAUTS_SUBMITTED);
					list.add(STAUTS_INTERNAL_APPROVED);
					list.add(STAUTS_EXTERNAL_APPROVED);
					list.add(STAUTS_PURCHASING_ACCEPTED);
					list.add(STAUTS_SP_ALLOCATED);
					list.add(STAUTS_SOURCING_COMPLETED);
					list.add(STAUTS_PR_CLOSED);
					list.add(STAUTS_CANCELLED);
				}
			}
		
			public static class Np_SpStauts{
				final public static Integer STAUTS_DRAFT=0;
				final public static Integer STAUTS_ALLOCATED=1;
				final public static Integer STAUTS_REJECTED=2;
				final public static Integer STAUTS_APPROVING=3;
				final public static Integer STAUTS_APPROVED=4;
				final public static Integer STAUTS_PROCESSSING=5;
				final public static Integer STAUTS_COMPLETED=6;
				final public static Integer STAUTS_CANCELLED=7;
				
				public static List<Integer> list=new ArrayList<Integer>();
				static{
					list.add(STAUTS_DRAFT);
					list.add(STAUTS_ALLOCATED);
					list.add(STAUTS_REJECTED);
					list.add(STAUTS_APPROVING);
					list.add(STAUTS_APPROVED);
					list.add(STAUTS_PROCESSSING);
					list.add(STAUTS_COMPLETED);
					list.add(STAUTS_CANCELLED);
				}
			}
			
			public static class PortalTask_type{
				final public static String TASK_PLAN="fs_PLAN";
				final public static String TASK_IMPROV="fs_IMPROV";
				final public static String TASK_CIP="fs_CIP";
				
				public static List<String> list=new ArrayList<String>();
				static{
					list.add(TASK_PLAN);
					list.add(TASK_IMPROV);
					list.add(TASK_CIP);
				}
			}
			
			public static class PortalTask_Operation{
				final public static String REJECT="reject";
				final public static String FORWARD="forward";
				final public static String CUTOUT="cutout";
				final public static String COMPLETE="complete";
				final public static String TIMEOUT="timeout";
				
				public static List<String> list=new ArrayList<String>();
				static{
					list.add(REJECT);
					list.add(FORWARD);
					list.add(CUTOUT);
					list.add(COMPLETE);
					list.add(TIMEOUT);
				}
			}
			
			
			public static class SysUniqueCode{
				final public static String CODE_BY_COMPANY = "COMPANY_CODE";
			}
			
			public static class BusObjectType{
				final public static String LEAVE_MESSAGE = "LEAVE_MESSAGE";
			}
			
			
			
			/**
			 * 树节点类型标识
			 * @author Administrator
			 *
			 */
		   public static class PortalNodeType{
			   public static Integer PROJECR = 0;
			   public static Integer SYSTEM = 1;
			   public static Integer MODULE = 2;
			   public static Integer SERVICE = 3;
			   public static Integer OBJECT = 4;
			   public static Integer SQLTEMPLATE =5;
			   public static List<Integer> list=new ArrayList<Integer>();
				static{
					list.add(PROJECR);
					list.add(SYSTEM);
					list.add(MODULE);
					list.add(SERVICE);
					list.add(OBJECT);
					list.add(SQLTEMPLATE);
				}
		   }
}
